﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GmFamilyService.h"
#include "IExternalObject.h"
#include "FamilyConnectorTypeAndShape.h"

namespace gcmp
{
    class IDocument;
}

namespace gfam
{

    class GM_FAMILY_SERVICE_EXPORT IFamilyConnectorTypeManager : public gcmp::IExternalObject
    {
        DEFINE_CAST_BASE(IFamilyConnectorTypeManager)
    public:
        /// \brief 获取连接件类型管理器
        ///
        /// \param pDocument 文档指针，输入为空时，创建失败，返回nullptr
        /// \return 创建成功返回连接件类型管理器，创建失败返回nullptr
        static IFamilyConnectorTypeManager* Get(gcmp::IDocument* pDocument);

        /// \brief 获取连接件类型
        /// 
        /// \param ConnectorTypeId 连接件类型Id
        /// \return 连接件类型
        virtual IFamilyConnectorType * GetFamilyConnectorType(Int32 ConnectorTypeId) = 0;

        /// \brief 创建连接件类型
        ///
        /// \param ConnectorTypeId 连接件类型id
        /// \param ConnectorTypeName 连接件类型名称
        /// \param description 连接件描述信息
        /// \return 创建成功返回连接件类型，创建失败返回nullptr
        virtual IFamilyConnectorType * CreateFamilyConnectorType(Int32 ConnectorTypeId, const std::wstring& ConnectorTypeName, const  std::wstring &description) = 0;
    };
}